package com.vogelsk.archangelsk.creatures;

import com.vogelsk.archangelsk.creatures.util.Direction;

public abstract class GenericCreature {
	
	


	public GenericCreature(int size, int x, int y, int speed,
			Direction direction) {
		super();
		this.size = size;
		this.x = x;
		this.y = y;
		this.direction = direction;
		this.speed = speed;
		this.setDestroyed(false);
	}

	private int size;
    private int x;
    private int y;
    private int speed;
    private Direction direction;
    private boolean destructable;   
	private boolean destroyed;
    
	public void move() {
		if( !isDestroyed()){
			if (getDirection().equals(Direction.LEFT)) {
				x -= size * speed;
			}
	
			if (getDirection().equals(Direction.RIGHT)) {
				x += size * speed;
			}
	
			if (getDirection().equals(Direction.UP)) {
				y -= size * speed;
			}
	
			if (getDirection().equals(Direction.DOWN)) {
				y += size * speed;
			}
		}
	}
	

	public void setY(int y) {
		this.y = y;
	}
	public int getY() {
		return y;
	}
	public void setX(int x) {
		this.x = x;
	}
	public int getX() {
		return x;
	}
	public void setSize(int size) {
		this.size = size;
	}
	public int getSize() {
		return size;
	}
	public void setSpeed(int speed) {
		this.speed = speed;
	}
	public int getSpeed() {
		return speed;
	}
	public void setDirection(Direction direction) {
		this.direction = direction;
	}
	public Direction getDirection() {
		return direction;
	}


	public void setDestructable(boolean destructable) {
		this.destructable = destructable;
	}


	public boolean isDestructable() {
		return destructable;
	}


	public void setDestroyed(boolean destroyed) {
		this.destroyed = destroyed;
	}


	public boolean isDestroyed() {
		return destroyed;
	}

}
